import {createStore} from 'redux'
interface IState{
    totalPrice:number,
    allCheck:boolean,
    groups:any
}
let initState = {
    totalPrice:0,
    allCheck:false,
    groups:[],

}
function reducer(state=initState,action:any){
    state=JSON.parse(JSON.stringify(state))
    switch (action.type){
        case "INIT_DATA":
            state.groups = action.car.groups
        
            return state
        default:
            return state
    }
}
const store = createStore(reducer)
export default store